Carbon


NumToString

Header: NumberFormatting.h Carbon status: Supported

Converts a long integer value into a Pascal string.

void NumToString (
    SInt32 theNum, 
    Str255 theString
);
Parameter descriptions
theNum

A long integer value. If the value of the number in the parameter theNum is negative, the string begins with a minus sign; otherwise, the sign is omitted.

theString

On output, contains the Pascal string representation of the number. Leading zeros are suppressed, except that a value of 0 produces the string “0”. NumToString does not include thousand separators or decimal points in its formatted output.

DISCUSSION

NumToString creates a string representation of theNum as a base-10 value and returns the result in theString.

Unless patched by a script system with different rules, this function assumes that you are using standard numeric token processing, meaning that the Roman script system number processing rules are used.

For functions that make use of the token-processing information that is found in the tokens ('itl4') resource of script systems for converting numbers, see the sections “Using Number Format Specification Strings for International Number Formatting” and “Converting Between Strings and Floating-Point Numbers”.

SPECIAL CONSIDERATIONS

NumToString may move memory; your application should not call this function at interrupt time.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.

CARBON NOTES

Use NumToString instead.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)